|
|
Try this:
$Z = <2, 0>;
#debug concat(str(creal(Z),10,10), " ", str(cimag(Z),10,10), "\n")
$Z2 = cmult(Z, Z);
#debug concat(str(creal(Z2),10,10), " ", str(cimag(Z2),10,10), "\n")
$Z2 = cpow(Z, 2);
#debug concat(str(creal(Z2),10,10), " ", str(cimag(Z2),10,10), "\n")
The expected result is that the second and third line should be identical
(or at least almost identical), since 'Z*Z' is the same thing as 'Z^2'.
However, the cpow() function seems to work extremely buggy. At least
in this Solaris 7 that code outputs the following:
2.0000000000 0.0000000000
4.0000000000 0.0000000000
0.7338278990 3.9321109616
The second line (ie. the result of cmult(Z,Z)) is ok, but the third
line (result of cpow(Z,2)) seems to be completely wrong.
--
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/
Post a reply to this message
|
|